package bible.sunflower.work.yinfeng.webservice;

import bible.sunflower.util.webservice.XFire4WSHelper;

public class ServiceHandler {
	
	private static void callHoyiLoginService(){
		String wsdlURL = "http://192.168.1.111:8080/default/DesktopService?wsdl";
		String methodName = "login4android";
		String[] params = {"0240", "000000"};
		Object[] results = XFire4WSHelper.callSampleWS(wsdlURL, methodName, params);
		if( results != null && results.length > 0 ){
			for( Object result : results ){
				System.out.println( "result = " + result);
			}
		}
	}
	
	private static void callQQOnlineService(){
		String wsdlURL = "http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl";
		String methodName = "qqCheckOnline";
		String[] params = {"123382372"};
		Object[] results = XFire4WSHelper.callSampleWS(wsdlURL, methodName, params);
		if( results != null && results.length > 0 ){
			for( Object result : results ){
				System.out.println( "result = " + result);
			}
		}
	}
	
	private static void callWeatherService(){
		String wsdlURL = "http://www.webxml.com.cn/webservices/weatherwebservice.asmx?wsdl";
		String methodName = "getWeatherbyCityName";
		String[] params = {"上海"};
		Object[] results = XFire4WSHelper.callSampleWS(wsdlURL, methodName, params);
		if( results != null && results.length > 0 ){
			for( Object result : results ){
				System.out.println( "result1 = " + result);
			}
		}
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//callHoyiLoginService();
		callQQOnlineService();
		callWeatherService();
	}

}
